package com.java2_7;

public class codeb {

    //代码块
    //实例代码块（构造器代码块） 和 静态代码块
    private int age;
    private String name;
    private int index;

    public static String member;

    public void text(){
        System.out.println("this is a code!");
    }

    public static void main(String[] args) {
        codeb co = new codeb();
        co.setName("zhangsan");
        System.out.println(co.getName());
    }

    static {
        System.out.println("this is a code!"); //先于main函数

    }
    public int getAge() {
        return age;
    }

    public void setAge(int age) {
        this.age = age;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public int getIndex() {
        return index;
    }

    public void setIndex(int index) {
        this.index = index;
    }
}
